import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [{
  path: '/',
  component: () => import("../views/layout/Layout.vue"),
  children: [{
    path: "/",
    name: "Home",
    component: () => import("../views/home/Home.vue")
  }, {
    path: "/my",
    name: "My",
    component: () => import("../views/my/My.vue"),
  }, {
    path: "/updateInfo",
    name: "updateInfo",
    component: () => import("../views/my/children/updateInfo.vue")
  }, {
    path: "/order",
    name: "Order",
    component: () => import("../views/order/Order.vue")
  }]
}, {
  path: "/login",
  name: "Login",
  component: () => import("../views/login/Login.vue")
}, {
  path: "/register",
  name: "Register",
  component: () => import("../views/login/Register.vue")
}, {
  path: "/shop",
  name: "Shop",
  component: () => import("../views/shop/shop.vue")
}]

const router = new VueRouter({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes
})

export default router